﻿BEGIN TRAN

USE [Product]  /* change to your project DB */



/****** :  Table [dbo].[CodeList]  ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CodeList](
	[CodeListId] [smallint] NOT NULL,
	[Code] [nvarchar](150) NOT NULL,
	[Name] [nvarchar](250) NOT NULL,
	[IsVisible] [bit] NOT NULL,
	[Discriminator] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_CodeList] PRIMARY KEY CLUSTERED 
(
	[CodeListId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [CodeList] ON [dbo].[CodeList] 
(
	[Discriminator] ASC,
	[Code] ASC
)
INCLUDE ( [CodeListId]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO


GO
/****** :  Table [dbo].[CodeListTiny]  ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CodeListTiny](
	[CodeListTinyId] [tinyint] NOT NULL,
	[Code] [nvarchar](150) NOT NULL,
	[Name] [nvarchar](250) NOT NULL,
	[IsVisible] [bit] NOT NULL,
	[Discriminator] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_CodeListTiny] PRIMARY KEY CLUSTERED 
(
	[CodeListTinyId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO



/****** :  Table [dbo].[CodeListContentType]  ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CodeListContentType](
	[ContentTypeId] [tinyint] NOT NULL,
	[Code] [nvarchar](150) NOT NULL,
	[Name] [nvarchar](250) NOT NULL,
	[Suffix] [nvarchar](50) NOT NULL,
	[IsVisible] [bit] NOT NULL,
 CONSTRAINT [PK_ContentType] PRIMARY KEY CLUSTERED 
(
	[ContentTypeId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO


--ROLLBACK TRAN
COMMIT TRAN